import { createApp } from 'vue'
import App from './App.vue'

import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';

import './assets/styles/css.scss'


import ECharts from 'vue-echarts'
import { use } from "echarts/core"

// import ECharts modules manually to reduce bundle size
import {
  CanvasRenderer
} from 'echarts/renderers'
import {
  GridComponent,
  TooltipComponent
} from 'echarts/components'

use([
  CanvasRenderer,
  GridComponent,
  TooltipComponent
])


import router from './router'
import customComponents from './components'

const app = createApp(App)

app.use(router)

//注册所有全局组件
// type Key = 'ArrowTitle' | 'GlassBox'
// let keys:Key[] = Object.keys<Key[]>(customComponents)
// keys.forEach((key:any) => {
//   let name:string = 'X' + key
//   app.component(name, customComponents[key])
// })

import XLoading from './components/Loading'
app.component('XLoading', XLoading)

import XColorBlockText from './components/ColorBlockText'
app.component('XColorBlockText', XColorBlockText)

import XPagination from './components/Pagination'
app.component('XPagination', XPagination)

app.component('v-chart', ECharts)

app.use(Antd)
app.mount('#app')
